From: Happy-melon Date: Sat, 12 Mar 2011 22:42:58 +0000 (+0000) Subject: Spin out all the CSS used on special pages into their own mediawiki.special module... X-Git-Tag: 1.31.0-rc.0~31493 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=b9be69ce3d6be06b739ebc0606ca42d3aa68f24b;p=lhc%2Fweb%2Fwiklou.git Spin out all the CSS used on special pages into their own mediawiki.special module. This comprises about a third of /skins/common/shared.css, so it's definitely worthwhile not loading it for the 99.9% of pageviews which aren't special pages. --- diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index 1f39971fab..eb1fe80a1a 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -59,6 +59,8 @@ class SpecialAllmessages extends SpecialPage { $this->outputHeader( 'allmessagestext' ); } + $wgOut->addModuleStyles( 'mediawiki.special' ); + $this->filter = $wgRequest->getVal( 'filter', 'all' ); $this->prefix = $wgRequest->getVal( 'prefix', '' ); diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 04b8d202b2..1fe2a96f39 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -76,6 +76,7 @@ class SpecialAllpages extends IncludableSpecialPage { wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : wfMsg( 'allarticles' ) ); + $wgOut->addModuleStyles( 'mediawiki.special' ); if( isset($par) ) { $this->showChunk( $namespace, $par, $to ); diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index f173954c49..75410486ba 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -78,7 +78,7 @@ class SpecialBlock extends SpecialPage { } $wgOut->setPageTitle( wfMsg( 'blockip-title' ) ); - $wgOut->addModules( 'mediawiki.special.block' ); + $wgOut->addModules( 'mediawiki.special', 'mediawiki.special.block' ); $fields = self::getFormFields(); $this->alreadyBlocked = $this->maybeAlterFormDefaults( $fields ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index d4fb9452f2..406c0f3a41 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -40,6 +40,7 @@ class SpecialContributions extends SpecialPage { $this->setHeaders(); $this->outputHeader(); + $wgOut->addModuleStyles( 'mediawiki.special' ); $this->opts = array(); diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 6127122710..2d058a915e 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -88,6 +88,7 @@ class SpecialEmailUser extends UnlistedSpecialPage { $this->setHeaders(); $this->outputHeader(); + $wgOut->addModuleStyles( 'mediawiki.special' ); $this->mTarget = is_null( $par ) ? $wgRequest->getVal( 'wpTarget', $wgRequest->getVal( 'target', '' ) ) diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index e351729d58..63dd2b828e 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -51,6 +51,7 @@ class SpecialListGroupRights extends SpecialPage { $this->setHeaders(); $this->outputHeader(); + $wgOut->addModuleStyles( 'mediawiki.special' ); $wgOut->addHTML( Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) . diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 55309f3f1c..5797f35a99 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -42,6 +42,7 @@ class SpecialPrefixindex extends SpecialAllpages { $this->setHeaders(); $this->outputHeader(); + $wgOut->addModuleStyles( 'mediawiki.special' ); # GET values $from = $wgRequest->getVal( 'from', '' ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 02f21a7749..79ca41cc50 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -44,6 +44,7 @@ class SpecialSearch extends SpecialPage { $this->setHeaders(); $this->outputHeader(); $wgOut->allowClickjacking(); + $wgOut->addModuleStyles( 'mediawiki.special' ); // Strip underscores from title parameter; most of the time we'll want // text form here. But don't strip underscores from actual text params! diff --git a/includes/specials/SpecialSpecialpages.php b/includes/specials/SpecialSpecialpages.php index d13fb0358c..9832137f48 100644 --- a/includes/specials/SpecialSpecialpages.php +++ b/includes/specials/SpecialSpecialpages.php @@ -37,6 +37,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage { $this->setHeaders(); $this->outputHeader(); $wgOut->allowClickjacking(); + $wgOut->addModuleStyles( 'mediawiki.special' ); $groups = $this->getPageGroups(); diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index d043863c52..046f5254dd 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -41,6 +41,7 @@ class SpecialStatistics extends SpecialPage { global $wgDisableCounters, $wgMiserMode; $this->setHeaders(); + $wgOut->addModuleStyles( 'mediawiki.special' ); $this->views = SiteStats::views(); $this->edits = SiteStats::edits(); diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index e03f439974..606b669b62 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -112,7 +112,7 @@ class UserrightsPage extends SpecialPage { } $this->outputHeader(); - + $wgOut->addModuleStyles( 'mediawiki.special' ); $this->setHeaders(); // show the general form diff --git a/resources/Resources.php b/resources/Resources.php index 7d4f50e4e6..ba7f7bf63c 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -416,6 +416,12 @@ return array( 'scripts' => 'resources/mediawiki.action/mediawiki.action.watch.ajax.js', 'dependencies' => 'mediawiki.util', ), + + /* Special pages */ + + 'mediawiki.special' => array( + 'styles' => 'resources/mediawiki.special/mediawiki.special.css', + ), 'mediawiki.special.preferences' => array( 'scripts' => 'resources/mediawiki.special/mediawiki.special.preferences.js', 'styles' => 'resources/mediawiki.special/mediawiki.special.preferences.css', @@ -444,6 +450,7 @@ return array( ), 'dependencies' => array( 'mediawiki.util.jpegmeta' ), ), + 'mediawiki.language' => array( 'scripts' => 'resources/mediawiki.language/mediawiki.language.js', 'languageScripts' => array( diff --git a/resources/mediawiki.special/mediawiki.special.css b/resources/mediawiki.special/mediawiki.special.css new file mode 100644 index 0000000000..f1e40a1e21 --- /dev/null +++ b/resources/mediawiki.special/mediawiki.special.css @@ -0,0 +1,262 @@ + +/**** Special:AllMessages ****/ +#mw-allmessagestable .allmessages-customised td.am_default { + background-color: #fcffc4; +} + +#mw-allmessagestable tr.allmessages-customised:hover td.am_default { + background-color: #faff90; +} + +#mw-allmessagestable td.am_actual { + background-color: #e2ffe2; +} + +#mw-allmessagestable tr.allmessages-customised:hover + tr.allmessages-customised td.am_actual { + background-color: #b1ffb1; +} + +/**** Special:Allpages ****/ +table.mw-allpages-table-form, table.mw-allpages-table-chunk { + width: 100%; +} +td.mw-allpages-alphaindexline { + text-align: right; +} +td.mw-allpages-nav, p.mw-allpages-nav { + text-align: right; + font-size: smaller; + margin-bottom: 1em; +} +table.mw-allpages-table-form tr { + vertical-align: top; +} + +/**** Special:Block ****/ +tr.mw-block-hideuser { + font-weight: bold; +} + +/**** Special:Contributions ****/ +.mw-uctop { + font-weight: bold; +} + +/**** Special:EmailUser ****/ +table.mw-emailuser-table { + width: 98%; +} +td#mw-emailuser-sender, +td#mw-emailuser-recipient { + font-weight: bold; +} + +/**** Special:ListGroupRights ****/ +table.mw-listgrouprights-table tr { + vertical-align: top; +} +.listgrouprights-revoked { + text-decoration: line-through; +} + +/**** Special:Prefixindex ****/ +table#mw-prefixindex-list-table, +table#mw-prefixindex-nav-table { + width: 98%; +} +td#mw-prefixindex-nav-form { + font-size: smaller; + margin-bottom: 1em; + text-align: right; + vertical-align: top; +} + + +/**** Special:Search ****/ +.searchresults { +} + +.searchresults p { + margin-left: 0.4em; + margin-top: 1em; + margin-bottom: 1.2em; +} +div.searchresult { + font-size: 95%; + width: 38em; +} +.mw-search-results { + margin-left: 0.4em; +} +.mw-search-results li { + padding-bottom: 1em; + list-style: none; + list-style-image: none; +} +.mw-search-results li a { + font-size: 108%; +} +.mw-search-result-data { + color: green; + font-size: 97%; +} +.mw-search-formheader { + background-color: #f3f3f3; + margin-top: 1em; + border: 1px solid silver; +} +.mw-search-formheader div.search-types { + float: left; + padding-left: 0.25em; +} +.mw-search-formheader div.search-types ul { + margin: 0 !important; + padding: 0 !important; + list-style: none !important; +} +.mw-search-formheader div.search-types ul li { + float: left; + margin: 0; + padding: 0; +} +.mw-search-formheader div.search-types ul li a { + display: block; + padding: 0.5em; +} +.mw-search-formheader div.search-types ul li.current a { + color: #333333; + cursor: default; +} +.mw-search-formheader div.search-types ul li.current a:hover { + text-decoration: none; +} +.mw-search-formheader div.results-info { + float: right; + padding: 0.5em; + padding-right: 0.75em; +} +.mw-search-formheader div.results-info ul { + margin: 0 !important; + padding: 0 !important; + list-style: none !important; +} +.mw-search-formheader div.results-info ul li { + float: right; + margin: 0; + padding: 0; +} +fieldset#mw-searchoptions { + margin: 0; + padding: 0.5em 0.75em 0.75em 0.75em !important; + border: none; + background-color: #f9f9f9; + border: 1px solid silver !important; + border-top-width: 0 !important; +} +fieldset#mw-searchoptions legend { + display: none; +} +fieldset#mw-searchoptions h4 { + padding: 0; + margin: 0; + float: left; +} +fieldset#mw-searchoptions div#mw-search-togglebox { + float: right; +} +fieldset#mw-searchoptions div#mw-search-togglebox label { + margin-right: 0.25em; +} +fieldset#mw-searchoptions div#mw-search-togglebox input { + margin-left: 0.25em; +} +fieldset#mw-searchoptions table { + float: left; + margin-right: 3em; +} +fieldset#mw-searchoptions table td { + padding-right: 1em; +} +fieldset#mw-searchoptions div.divider { + clear: both; + border-bottom: 1px solid #DDDDDD; + padding-top: 0.5em; + margin-bottom: 0.5em; +} +td#mw-search-menu { + padding-left:6em; + font-size:85%; +} +div#mw-search-interwiki { + float: right; + width: 18em; + border: 1px solid #AAAAAA; + margin-top: 2ex; +} +div#mw-search-interwiki li { + font-size: 95%; +} +.mw-search-interwiki-more { + float: right; + font-size: 90%; +} +div#mw-search-interwiki-caption { + text-align: center; + font-weight: bold; + font-size: 95%; +} +.mw-search-interwiki-project { + font-size: 97%; + text-align: left; + padding: 0.15em 0.15em 0.2em 0.2em; + background-color: #ececec; + border-top: 1px solid #BBBBBB; +} +span.searchalttitle { + font-size: 95%; +} +div.searchdidyoumean { + font-size: 127%; + margin-top: 0.8em; + /* Note that this color won't affect the link, as desired. */ + color: #c00; +} +div.searchdidyoumean em { + font-weight: bold; +} +.searchmatch { + font-weight: bold; +} +/* Advanced PowerSearch box */ +td#mw-search-togglebox { + text-align: right; +} +table#mw-search-powertable { + width: 100%; +} +form#powersearch { + clear: both; +} + +/**** Special:Specialpages ****/ +.mw-specialpagecached { + font-style:italic; +} +.mw-specialpagerestricted { + font-weight:bold; +} + + +/**** Special:Statistics ****/ +td.mw-statistics-numbers { + text-align: right; +} + +/**** Special:UserRights ****/ +.mw-userrights-disabled { + color: #888; +} +table.mw-userrights-groups * td, +table.mw-userrights-groups * th { + padding-right: 1.5em; +} \ No newline at end of file diff --git a/skins/common/shared.css b/skins/common/shared.css index 75df71bb5c..faadfb70f7 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -11,7 +11,9 @@ /* Links to redirects appear italicized on [[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Watchlist/edit]] and in category listings */ -.allpagesredirect, .redirect-in-category, .watchlistredir { font-style: italic; } +.allpagesredirect, .redirect-in-category, .watchlistredir { + font-style: italic; +} /* Comment and username portions of RC entries */ span.comment { @@ -145,213 +147,6 @@ p.mw-revdel-editreasons { float: right; } -/* Search results */ -.searchresults { -} - -.searchresults p { - margin-left: 0.4em; - margin-top: 1em; - margin-bottom: 1.2em; -} - -div.searchresult { - font-size: 95%; - width: 38em; -} - -.mw-search-results { - margin-left: 0.4em; -} - -.mw-search-results li { - padding-bottom: 1em; - list-style: none; - list-style-image: none; -} -.mw-search-results li a { - font-size: 108%; -} - -.mw-search-result-data { - color: green; - font-size: 97%; -} - -.mw-search-formheader { - background-color: #f3f3f3; - margin-top: 1em; - border: 1px solid silver; -} -.mw-search-formheader div.search-types { - float: left; - padding-left: 0.25em; -} -.mw-search-formheader div.search-types ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.search-types ul li { - float: left; - margin: 0; - padding: 0; -} -.mw-search-formheader div.search-types ul li a { - display: block; - padding: 0.5em; -} -.mw-search-formheader div.search-types ul li.current a { - color: #333333; - cursor: default; -} -.mw-search-formheader div.search-types ul li.current a:hover { - text-decoration: none; -} -.mw-search-formheader div.results-info { - float: right; - padding: 0.5em; - padding-right: 0.75em; -} -.mw-search-formheader div.results-info ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.results-info ul li { - float: right; - margin: 0; - padding: 0; -} -fieldset#mw-searchoptions { - margin: 0; - padding-left: 0.75em !important; - padding-right: 0.75em !important; - padding-bottom: 0.5em !important; - padding-top: 0.5em !important; - border: none; - background-color: #f9f9f9; - border: 1px solid silver !important; - border-top-width: 0 !important; -} -fieldset#mw-searchoptions legend { - display: none; -} -fieldset#mw-searchoptions h4 { - padding: 0; - margin: 0; - float: left; -} -fieldset#mw-searchoptions div#mw-search-togglebox { - float: right; -} - -fieldset#mw-searchoptions div#mw-search-togglebox label { - margin-right: 0.25em; -} -fieldset#mw-searchoptions div#mw-search-togglebox input { - margin-left: 0.25em; -} -fieldset#mw-searchoptions table { - float: left; - margin-right: 3em; -} -fieldset#mw-searchoptions table td { - padding-right: 1em; -} -fieldset#mw-searchoptions div.divider { - clear: both; - border-bottom: 1px solid #DDDDDD; - padding-top: 0.5em; - margin-bottom: 0.5em; -} - -td#mw-search-menu { - padding-left:6em; - font-size:85%; -} - -div#mw-search-interwiki { - float: right; - width: 18em; - border-style: solid; - border-color: #AAAAAA; - border-width: 1px; - margin-top: 2ex; -} - -div#mw-search-interwiki li { - font-size: 95%; -} - -.mw-search-interwiki-more { - float: right; - font-size: 90%; -} - -div#mw-search-interwiki-caption { - text-align: center; - font-weight: bold; - font-size: 95%; -} - -.mw-search-interwiki-project { - font-size: 97%; - text-align: left; - padding-left: 0.2em; - padding-right: 0.15em; - padding-bottom: 0.2em; - padding-top: 0.15em; - background-color: #ececec; - border-top: 1px solid #BBBBBB; -} - -span.searchalttitle { - font-size: 95%; -} - -div.searchdidyoumean { - font-size: 127%; - margin-top: 0.8em; - /* Note that this color won't affect the link, as desired. */ - color: #c00; -} - -div.searchdidyoumean em { - font-weight: bold; -} - -.searchmatch { - font-weight: bold; -} - - -/* - * Advanced PowerSearch box - */ -td#mw-search-togglebox { - text-align: right; -} - -table#mw-search-powertable { - width: 100%; -} - -form#powersearch { - clear: both; -} - -/* - * UserRights stuff - */ -.mw-userrights-disabled { - color: #888; -} - -table.mw-userrights-groups * td,table.mw-userrights-groups * th { - padding-right: 1.5em; -} - /* * OpenSearch ajax suggestions */ @@ -435,73 +230,10 @@ table.os-suggest-results { font-weight: bold; } -/* Special:Contributions styling */ -.mw-uctop { - font-weight: bold; -} - -/* Special:ListGroupRights styling */ -table.mw-listgrouprights-table tr { - vertical-align: top; -} -.listgrouprights-revoked { - text-decoration: line-through; -} - -/* Special:Statistics styling */ -td.mw-statistics-numbers { - text-align: right; -} - #shared-image-dup, #shared-image-conflict { font-style: italic; } -/* Special:EmailUser styling */ -table.mw-emailuser-table { - width: 98%; -} -td#mw-emailuser-sender, td#mw-emailuser-recipient { - font-weight: bold; -} - -/* Special:Allpages styling */ -table.mw-allpages-table-form, table.mw-allpages-table-chunk { - width: 100%; -} -td.mw-allpages-alphaindexline { - text-align: right; -} -td.mw-allpages-nav, p.mw-allpages-nav { - text-align: right; - font-size: smaller; - margin-bottom: 1em; -} -table.mw-allpages-table-form tr { - vertical-align: top; -} - -/* Special:Prefixindex styling */ -table#mw-prefixindex-list-table, -table#mw-prefixindex-nav-table { - width: 98%; -} -td#mw-prefixindex-nav-form { - font-size: smaller; - margin-bottom: 1em; - text-align: right; - vertical-align: top; -} - -/* Special:Specialpages style */ -.mw-specialpagecached{ - font-style:italic; -} - -.mw-specialpagerestricted{ - font-weight:bold; -} - /* * Recreating deleted page warning * Reupload file warning @@ -669,23 +401,6 @@ table.collapsed tr.collapsable { background-color: #ccccff; } -/* Allmessages table */ -#mw-allmessagestable .allmessages-customised td.am_default { - background-color: #fcffc4; -} - -#mw-allmessagestable tr.allmessages-customised:hover td.am_default { - background-color: #faff90; -} - -#mw-allmessagestable td.am_actual { - background-color: #e2ffe2; -} - -#mw-allmessagestable tr.allmessages-customised:hover + tr.allmessages-customised td.am_actual { - background-color: #b1ffb1; -} - /* filetoc */ ul#filetoc { text-align: center;